import React from 'react'
import BaseForm from '@comp/Form/index'

export default class DialogForm extends BaseForm {
    // 表单验证
    public validateFields = (add:any) => {
        this.formRef.current.validateFields().then(() => {
            add()
        }).catch((err:any) => {
            // console.log(err)
            if(err){
                return
            }
        })
    }
    public setFieldsValue = (values:any) => {
        this.formRef.current.setFieldsValue(values)
    }
    public resetFields = (values?:any) => {
        this.formRef.current.resetFields(values)
    }
    public render() {
        return (
            <React.Fragment>
                {this.renderForm()}
            </React.Fragment>
        )
    }
}